package ru.ncedu.java.dmsi.robots.model;

// Point with state
public class StatePoint extends Point {
    private boolean state; // is occupy
    private WorldObject occupant;

    public StatePoint( Point p, WorldObject who ) {
        // 'Who' occupied point 'p'
        super(p);
        state = true;
        occupant = who;
    }
    public StatePoint( int x, int y, boolean st ) {
        super(x, y);
        state = st;
    }
    public boolean isOccupy() {
        return state;
    }
    public void occupy( WorldObject who ) {
        state = true;
        occupant = who;
    }
    public void free() {
        state = false;
        occupant = null;
    }
    public WorldObject getOccupant() {
        return occupant;
    }
}
